package com.woniu108.carService.commos.util;

public class RedisKey {

    public static String OrderCodeKey(String mobile){
        return "order:code:mobile:"+mobile;
    }

    public static String OrderCodeOneMinute(String mobile) {
        return "order:code:minute:mobile:" + mobile;
    }


    public static String sendMessageNumber(String mobile) {
        return "send:message:number:mobile:"+mobile;
    }

    //验证手机号
    public static String checkMobile(String mobile) {
        return "check:code:mobile:"+mobile;
    }
    //验证手机号短信在一分钟内发送的次数
    public static String checkMobileOneMinute(String mobile) {
        return "check:code:minute:mobile:"+mobile;
    }
    /**
     * 返回用户购物车列表的key
     */
    public static String userCart(String userId) {
        return "user:cart:userid:" + userId;
    }
    /**
     * 返回用户购物车中商品信息的key
     */
    public static String userCartGoods(String userId, Integer pInfoId) {
        return "usercartbook:userid:" + userId + ":pinfoid:" + pInfoId;
    }

    /**
     * 返回vip订单信息的key
     */
    public static String vipOrder(String orderNum){
        return "viporder:orderNum:"+orderNum;
    }

    /**
     * 商品订单分布式锁
     * @param pInfoId 商品详情id
     * @return
     */
    public static String orderProductLock(String pInfoId) {
        return "lock:order:product:pInfoId:"+pInfoId;
    }

    /**
     * 用户id的某订单的ZSet
     * @param orderProductNum 商品订单编号
     * @return
     */
    public static String orderProductPInfoSet(String orderProductNum) {
        return "order:product:num:"+orderProductNum+":pInfo:ids";
    }

    public static String orderProductPInfoByNumHash(String orderProductNum, Integer pInfoId) {
        return "order:product:num:"+orderProductNum+":pInfo:id:"+pInfoId;
    }
    /**
     * 返回用户是否已赠送过7天vip的key
     */
    public static String freeVip(String userId){
        return "freevip:userid:"+userId;
    }

    public static String chatSession(Integer friendId) {
        return "chat:session:friendid:"+friendId;
    }

    public static String orderProductPreState(String orderProductNum){
        return "order:product:pre:state:"+orderProductNum;
    }

    public static String orderProductRefund(String orderProductNum) {
        return "order:product:"+orderProductNum+":refund";
    }
}